const KEY = 'weather-setting'

const AppName = '预测未来五天天气变化'

function setSetting(data: any) {
  localStorage.setItem(KEY, JSON.stringify(data))
}

function getSetting() {
  try {
    const data = localStorage.getItem(KEY) || '{}'
    return JSON.parse(data)
  } catch (error) {
    return null
  }
}

export default {
  AppName,
  setSetting,
  getSetting,
}
